#!/usr/bin/env bash
#  vim:ts=4:sts=4:sw=4:et
#
#  Author: Hari Sekhon
#  Date: 2018-10-07 20:46:38 +0100 (Sun, 07 Oct 2018)
#
#  https://github.com/harisekhon/Dockerfiles
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
#  https://www.linkedin.com/in/harisekhon
#

# Get list of versions to be used by tests/check_for_new_version

set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x

get_versions(){
    curl -s http://archive.apache.org/dist/hadoop/common/ |
    # no grep -P on Mac, requires GNU grep :-/
    egrep -i -o 'href="hadoop-[[:digit:]]+(\.[[:digit:]]+)+(-[[:alpha:]]+)?' |
    grep -v -e alpha -e beta |
    sed 's/href="hadoop-//'
}

get_versions
